//
//  QZGeRenVC.m
//  map
//
//  Created by 000 on 16/10/21.
//  Copyright © 2016年 faner. All rights reserved.
//

#import "QZGeRenVC.h"
#import "QZSetVC.h"
#import "constant.h"
#import "QZHeaderView.h"
#import "QZFooterView.h"
@interface QZGeRenVC ()<UITableViewDelegate,UITableViewDataSource,QZFooterViewDelegate>
@property (strong, nonatomic) UITableView *tableView;
@property (nonatomic, strong) NSArray *datamArray;
@property (nonatomic, strong) NSArray *imageList;

@end

@implementation QZGeRenVC

- (UITableView *)tableView
{
    if (_tableView == nil) {
        _tableView = [[UITableView alloc] init];
        _tableView.frame = self.view.bounds;
        _tableView.dataSource = self;
        _tableView.delegate = self;
    }
    return _tableView;
}

- (NSArray *)datamArray
{
    if (_datamArray== nil) {
        _datamArray = @[@"背包",@"里程",@"关于",@"客服"];
    }
    return _datamArray;
}
 - (NSArray *)imageList
{
    if (_imageList == nil) {
        _imageList = @[@"",@"",@"",@""];
    }
    return _imageList;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"个人";
    self.tableView.tableHeaderView = [QZHeaderView headView];
    QZFooterView *footerView = [QZFooterView footerView];
    footerView.delegate = self;
    self.tableView.tableFooterView = footerView;
    [self.view addSubview:self.tableView];
}

#pragma mark - UITableViewDelegate,UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.datamArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    static NSString *cellID = @"ID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    cell.imageView.image = [UIImage imageNamed:self.imageList[indexPath.row]];
    cell.textLabel.text = self.datamArray[indexPath.row];
    return cell;
}
- (void)footerViewDidLogoutBtnClick{
    QZSetVC *setVc = [[QZSetVC alloc] init];
    [self.navigationController pushViewController:setVc animated:YES];
}

@end
